1. Field of the Invention
The present invention relates to virtual machine technology, and more specifically to a virtual machine deployment planning method and associated apparatus.
2. Description of Background
At present, the computer virtual machine technology is increasingly widely used, especially in a distributed environment. A virtual appliance corresponding to a virtual solution is divided into a plurality of virtual machines, i.e., virtual images. The virtual machines may be located in a same physical entity (e.g. a same computer) or in different physical entities.
FIG. 1 is a block diagram showing a processing device (e.g. computer) in the prior art. The processing device 1 comprises a virtual machine deployment and activation tool 11, virtual machines 12 and associated activation parameter profiles 13. The virtual machine deployment and activation tool 11 is used for creating and deploying the virtual machines 12 and coordinating activation of the virtual machines 12. The virtual machine 12 comprises an activation engine 121, activation items (activation scripts) 122 and an activation logical file 123.
The activation item 122 is a script compiled for a task that must be performed in the virtual machine 12. For example, if a web application server, a network and a database are to be deployed in a virtual machine, three scripts of ConfigWAS, ConfigNet and ConfigDB can be compiled for the virtual machine.
FIG. 3 shows contents of the activation logical file 123 in the prior art, comprising descriptive parameters of the activation items and dependence relations among the activation items. The descriptive parameters of the activation items are different from the activation parameters saved in the activation parameter profile 13. The activation parameters refer to those parameters that are required for activating the activation items, e.g., specific values of network IP addresses required for activating the network. The descriptive parameters of the activation items describe which activation parameters are needed, e.g. describing “needing network IP addresses”, but are not concerned with specific values.
As for the dependence relations among the activation items, as an example, as shown in FIG. 8A, the activation of the activation item B2 deployed on the virtual machine B depends on the activation of the activation item C2 deployed on the virtual machine C and the activation item B3 deployed on the virtual machine B; in turn, the activation of the activation items A2 and A3 deployed on the virtual machine A depends on the activation of the activation item B2 deployed on the virtual machine B.
The activation parameter profile 13 is a document for storing specific activation parameter values required for activating the activation items. The activation engine 121 is used for activating the activation items 122 in the virtual machine 12. It reads the specific activation parameters in the activation parameter profile 13 and invokes activation items 122 associated with the activation parameters when reading the associated activation parameters. The descriptive parameters of the activation items in the activation logical file 123 describe which activation parameters are required for activating the activation items. It provides a basis for specific values of which activation parameters are to be stored in the activation parameter profile 13.
FIG. 2 shows a process to be undergone before the virtual machine 12 is instanced on a physical entity, comprising: a creation phase, a deployment phase and an activation phase. The creation phase is a phase to install the activation engine 121, the activation items 122 and the activation logical file 123 comprised in the virtual machine into the physical entity. In a step S1, an image building tool 111 installs the activation engine 121 onto the physical entity. In a step S2, the image building tool 111 installs the activation items 122 compiled by the user onto the physical entity. In a step S3, the developer compiles into the activation logical file the activation item descriptive parameters and the dependence relations among the activation items. As shown in FIG. 1, in an instance, the step S1 may be executed by an activation engine installer 1111, the step S2 may be executed by an activation item installer 1112, and the step S3 is artificially executed by the developer, that is, there lacks an automatic execution tool.
The basic framework of the virtual machine 12 has been created through the virtual machine creation phase. However, the activation of the activation items 122 further needs specific activation parameters which are obtained through the virtual machine deployment phase. In a step S4, a deployment tool 112 generates a deployment parameter collection page for user deployment. In a step S5, after the user inputs the activation parameters, the deployment tool 112 receives the user inputted activation parameters. In a step S6, the deployment tool 112 generates the activation parameter profile 13 containing the user inputted activation parameters.
The activation of the activation items 122 can be performed only by use of the activation parameters in the activation parameter profile 13 in combination with the activation items 122. As shown in FIG. 1, in an instance, the step S4 may be executed by an activation parameter collection page generator 1121, the step S5 may be executed by an activation parameter receiver 1122, and the step S6 may be executed by an activation parameter profile generator 1123.
The activation phase is a phase for customizing required operating systems, networks, application resources and etc. for the virtual machines. The activation items created in the creation phase can be instanced only in the activation phase in combination with the activation parameters in the activation parameter profile 13. Since the activation logical file 123 stores the dependence relations among the activation items, the activation engine 121 must make reference to the dependence relations while invoking the activation items 122. The activation engine randomly selects an order of activating the activation items 122 inside the virtual machine on the premise that the dependence relations are not violated, but the order is not necessarily optimal. There lacks in the prior art a technique capable of automatically optimizing the activation order of the activation items 122 inside the virtual machines.
An activation coordinator 113 is responsible for, after an activation item in the virtual machine has been activated, notifying activation items depending on the activation item in other virtual machines of the start of activation. As shown in FIG. 8A, the activation of the activation item B1 deployed on the virtual machine B depends on the activation of the activation item C2 deployed on the virtual machine C. Therefore, after the activation engine in the virtual machine C activates the activation item C2, it notifies the activation coordinator 113 of that the activation item B1 in the virtual machine B that depends on the activation of the activation item C2 can be activated. The activation coordinator 113 notifies the activation engine in the virtual machine B of the activation of the activation item B 1.
A problem existing in the prior art is that, in the step S3, it is the developer that compiles in the activation logical file the activation item descriptive parameters and the dependence relations among the activation items. That is to say, the user must be proficient in compiling the activation logical file, as is difficult for those inexperienced users.
In addition, since in the prior art, the activation engine randomly selects an order of activating the activation items 122 inside the virtual machines on the premise that the dependence relations among the activation items in the activation logical file are not violated, the order is not necessarily optimal. Consequently, it is desirable to implement a technique capable of automatically optimizing the activation order of the activation items inside the virtual machines.